args <- commandArgs(TRUE)
setwd(args[1])
#.libPaths("/usr/local/biotools/r/R-2.15.0/lib64/R/library")
library(affy)
eset <- justRMA()
write.exprs(eset,"rma.txt",sep="\t")
data<-read.table("rma.txt",sep="\t",head=T)
rownames(data)<-data[,1]
data<-data[,2:ncol(data)]
#reading the negative id.s
ids<-read.table("Potential_Negative_converted_ids.txt",sep="\t",head=T)
data_Negative_converted <-data[intersect(as.vector(tolower(ids[,2])), as.vector(tolower(rownames(data)))),]
#reading the positiveid.s
ids<-read.table("Potential_Positive_converted_ids.txt",sep="\t",head=T)
data_Positive_converted<- data[intersect(as.vector(tolower(ids[,2])), as.vector(tolower(rownames(data)))),]
write(data_Negative_converted, file="negative.txt", sep="\t")
write(data_Positive_converted, file="positive.txt", sep="\t")

